package com.sayonaragutgut.android.core;

import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;

import com.sayonaragutgut.android.core.VagasEntry;

public class VagasDataService {
	// classe mock para testes:
	private HashMap<Integer, VagasEntry> map;
	
	public VagasDataService() {
		map = new HashMap<Integer, VagasEntry>();
		for (int i = 0; i < 50; ++i) {
			map.put(i,
					new VagasEntry("Vaga " + i,
							"Empresa " + i,
							(i % 3 == 0) ? "SP" : "CE",
							"São Paulo"));
		}
	}
	
	public VagasEntry getVagaEntryById(int id) {
		if (!map.containsKey(id))
			return null;
		
		return map.get(id);
	}
	
	public List<VagasEntry> getVagasEntries() {
		List<VagasEntry> result = new ArrayList<VagasEntry>();
		for (VagasEntry entry : map.values())
			result.add(entry);
				
		return result;
	}
}
